package day04;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/11
 */
public class ArrayReverse {
    public static void main(String[] args) {
        int[] a ={5,11,15,24,36,47,59,66};

        int i = 0;
        int j = a.length-1;

        System.out.println("逆序前：");
        for (int item : a) {
            System.out.print(item +" ");
        }

        while(i<j){
            int temp = a[j];
            a[j] = a[i];
            a[i] = temp;
            i++;
            j--;
        }

        System.out.println();

        System.out.println("逆序后：");
        for (int item : a) {
            System.out.print(item+" ");
        }

    }
}
